#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main() 
{
    long long n;
    cin>>n;
    long long num = n, ans, i = 2;
    while (i * i <= num) {
        if (num % i == 0) ans = i;
        while (num % i == 0) num /= i;
        i++;
    }
    if (num != 1) ans = num;
    printf("%lld\n", ans);
    return 0;
} 
